package com.hc.trans;

import com.hc.common.bean.PageBean;
import com.hc.domain.Author;
import com.hc.res.AuthorDTO;
import com.hc.res.AuthorListDTO;
import org.mapstruct.Mapper;
import org.mapstruct.MappingTarget;
import org.mapstruct.factory.Mappers;

/**
 * 转换数据 - 作者列表
 * @author zhitb
 */
@Mapper
public interface AuthorTrans {
    AuthorTrans MAPPER = Mappers.getMapper(AuthorTrans.class);

    /**
     * 将author转换成AuthorDTO
     * @param author
     * @return
     */
    AuthorDTO author2AuthorDTO(Author author);


    /**
     * 将PageBean<Author>转换为PageBean<AuthorDTO>
     * @param author
     * @return
     */
    PageBean<AuthorDTO> author2AuthorDTO(PageBean<Author> author);

    AuthorListDTO author2AuthorListDTO(Author author);
    /**
     * 将PageBean<Author>转换为PageBean<AuthorDTO>
     * @param authorPageBean
     * @param authorDTOPageBean
     */
    void author2AuthorDTO(PageBean<Author> authorPageBean, @MappingTarget PageBean<AuthorDTO> authorDTOPageBean);
}
